home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / Show&Edit_1.8 / ARexx / XSelect.dopus5 < prev   
Text File  |  1996-11-28  |  1KB  |  68 lines

  1. /* $VER: XSelect.dopus5 1.0 (28.11.96) Frederic Steinfels
  2. */
  3.  
  4. /*    History:
  5.  
  6.     1.0    First try
  7.     
  8.     1.1    If you selected some files in icon mode, dopus also took
  9.         the files in name mode. Now, dopus deselects all files
  10.         in name mode first if you are in icon mode.
  11. */
  12.  
  13. options failat 21
  14. options results
  15. parse arg arguments
  16.  
  17. Call Init
  18. address value PORT
  19. Call XSelect
  20. Return
  21.  
  22.  
  23. XSelect:
  24. lister query handle mode
  25. if UPPER(result) ~= 'NAME' then do
  26.     drop result
  27.     lister query handle numselentries
  28.     numsel=result
  29.     do while numsel > 0
  30.         lister query handle firstsel
  31.         lister select handle result off
  32.         numsel=numsel-1
  33.     end
  34. end
  35.     
  36. cnt=0
  37. do while cnt < FILES.count
  38.     lister select handle '"' || FILES.cnt || '"' ON
  39.     cnt=cnt+1
  40. end
  41. return
  42.  
  43.  
  44.  
  45. Init:
  46. libname = "rexxdossupport.library"
  47. if ~show("L", libname) then do
  48.   if ~addlib(libname, 0, -30, 2) then do
  49.     say libname "not added!"
  50.     exit
  51.   end
  52. end
  53.  
  54. ProgramName = "XSelect.rexx"
  55. ArgsTemplate = "PORT/A,HANDLE/A,FILES/M"
  56. lf='0a'x
  57.  
  58. if strip(arguments) = '?' then do
  59.     call writech(STDOUT, ArgsTemplate || ': ')
  60. pull arguments
  61. end; else nop
  62. if ~ReadArgs(arguments,ArgsTemplate) then do
  63.     say Fault(RC,ProgramName)
  64.      exit 10
  65. end; else nop
  66. drop arguments
  67. return
  68.